Add CONFIG_X86_NO_IDT to exclude all code which references the idt table.
Also fix the non-Xen cpu_gdt_init() handling.
From: Jan Beulich <JBeulich@novell.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
depends on X86_64_XEN
default y
+config X86_NO_IDT
+ bool
+ depends on X86_64_XEN
+ default y
+
#
# Define implied options from the CPU selection here
#
/* zero the remaining page */
.fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0
- .section .bss, "aw", @nobits
- .align L1_CACHE_BYTES
-ENTRY(idt_table)
- .rept 256
- .quad 0
- .quad 0
- .endr
-
/*
* __xen_guest information
*/
struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly;
struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned;
+#ifndef CONFIG_X86_NO_IDT
struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table };
+#endif
char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
void __init cpu_gdt_init(struct desc_ptr *gdt_descr)
{
-#ifdef CONFIG_SMP
- int cpu = stack_smp_processor_id();
-#else
- int cpu = smp_processor_id();
-#endif
-
- asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu]));
+ asm volatile("lgdt %0" :: "m" (*gdt_descr));
asm volatile("lidt %0" :: "m" (idt_descr));
}
#endif
#endif
cpu_gdt_descr[cpu].size = GDT_SIZE;
-#ifndef CONFIG_XEN
- asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu]));
- asm volatile("lidt %0" :: "m" (idt_descr));
-#else
cpu_gdt_init(&cpu_gdt_descr[cpu]);
-#endif
memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8);
syscall_init();
#include <asm/proto.h>
#include <asm/nmi.h>
+#ifndef CONFIG_X86_NO_IDT
extern struct gate_struct idt_table[256];
+#endif
asmlinkage void divide_error(void);
asmlinkage void debug(void);
printk("HYPERVISOR_set_trap_table faild: error %d\n",
ret);
-#ifdef CONFIG_IA32_EMULATION
- set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
-#endif
-
/*
* Should be a barrier for any external CPU state.
*/
* something other than this.
*/
extern struct desc_struct default_ldt[];
+#ifndef CONFIG_X86_NO_IDT
extern struct gate_struct idt_table[];
+#endif
extern struct desc_ptr cpu_gdt_descr[];
/* the cpu gdt accessor */
memcpy(adr, &s, 16);
}
+#ifndef CONFIG_X86_NO_IDT
static inline void set_intr_gate(int nr, void *func)
{
BUG_ON((unsigned)nr > 0xFF);
{
_set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, ist);
}
+#endif
static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type,
unsigned size)